﻿using System.Text;
using SqlFormat;

namespace SqlFormatTest {
    public class MockSqlFormatter : SqlFormatter<SqlFormatterOptions> {
        private string _beforeString;
        private string _afterString;
        private string _BeforeKeyWordString;
        private string _AfterKeyWordString;

        public MockSqlFormatter(SqlFormatterOptions options)
            : base(options) {
        }

        protected override string BeforeString {
            get { return _beforeString; }
        }

        public string _BeforeString {
            set { _beforeString = value; }
        }

        protected override string AfterString {
            get { return _afterString; }
        }

        public string _AfterString {
            set { _afterString = value; }
        }

        public string _BeforeKeyWord {
            set { _BeforeKeyWordString = value; }
        }

        public string _AfterKeyWord {
            set { _AfterKeyWordString = value; }
        }

        protected override string BeforeKeyWordString {
            get { return _BeforeKeyWordString; }
        }

        protected override string AfterKeyWordString {
            get { return _AfterKeyWordString; }
        }

        protected override string NewLineString {
            get {
                StringBuilder sb = new StringBuilder("\n");
                for (int i = 0; i < Indent; i++) {
                    sb.Append('\t');
                }
                return sb.ToString();
            }
        }
    }
}
